const db = require('../common/mongoose'),
  mongoose = db.mongoose,
  Schema = db.Schema;

let SsqSchema = new Schema({
  day:  {type: String},       // 日期
  sequence: {type: Number, unique: true},   // 期号
  lottery: {
    one:  {type: Number},
    two:  {type: Number},
    three:  {type: Number},
    four:  {type: Number},
    five:  {type: Number},
    six:  {type: Number},
    blue:  {type: Number},
    orders: [{
      type: Number,
    }]
  },
  sales: {type: Number},    // 本期销售额
  total: {type: Number},    // 奖池滚存
  bill: {
    one: {    // 一等奖
      count: {type: Number},
      money: {type: Number},
    },
    two:  {
      count: {type: Number},
      money: {type: Number},
    },
    three:  {
      count: {type: Number},
      money: {type: Number},
    },
    four:  {
      count: {type: Number},
      money: {type: Number},
    },
    five:  {
      count: {type: Number},
      money: {type: Number},
    },
    six:  {
      count: {type: Number},
      money: {type: Number},
    },
  },
  // 创建时间
  createTime: {type: Date, default: Date.now},
  // 修改时间
  updateTime: {type: Date, default: Date.now},
  // 删除时间
  deleteTime: {type: Date, },
  // 操作人
  operator: {type: String, },
  // 操作人id
  operatorId: {type: String, },
  // 备注
  remarks: {type: String, }
});

let SsqModel = mongoose.model('Ssq', SsqSchema, 'ssq');

module.exports = SsqModel;